home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / SCSI Manager 4.3f1 / For previous 4.3 developers / ConvertNames < prev   
Encoding:
Text File  |  1993-05-03  |  902 b   |  37 lines  |  [TEXT/MPS ]

  1. # Warning: This will change all of your source code! (I suggest you make
  2. #    a copy of the target directory before running it.
  3. # Instructions:
  4. #    Set the current directory to desired target directory
  5. #     Put "canon.dict" into that directory and run the following script
  6.  
  7.  
  8. set curdir "`directory`"
  9.  
  10. set newdir "`getfilename -d -m 'Select directory to convert.'`"
  11. exit if !{newdir} 
  12. set dict "`getfilename -m 'Select canon dictionary.'`"
  13. exit if !{dict} 
  14.  
  15. directory {newdir}
  16.  
  17. # Canon the files into <file>-canon
  18.  
  19. for each in  ≈.h ≈.c ≈.a
  20.     echo "{each}"
  21.     canon "{dict}" "{each}" > "{each}"-canon
  22. end
  23.  
  24. # Catenate x-canon file back into original file (to save ckids etc.)
  25.  
  26. for converted in  ≈.h-canon ≈.c-canon ≈.a-canon
  27.     (evaluate "{converted}" =~ /(≈)®1-canon/) ∑∑ Dev:Null
  28.     set original "{®1}"
  29.     echo "{converted}" "{original}"
  30.     catenate  "{converted}" > "{original}"
  31. end
  32.  
  33. delete ≈-canon
  34.  
  35. directory {curdir}
  36.  
  37.